import React, { Component } from 'react'
import { HashRouter, Redirect, Route, Switch } from 'react-router-dom';
import Films from '../views/Films';
import Center from '../views/Center';
import Cinemas from '../views/Cinemas';
import NotFound from '../views/NotFound';
import Nowpalying from '../views/films/Nowpalying';
export default class Index extends Component {
    render() {
        return (
            <div>
                <HashRouter>
                    <Switch>
                        <Route path="/films" component={Films} />
                        <Route path="/films/nowplaying" component={Nowpalying} />
                        <Route path="/center" component={Center} />
                        <Route path="/cinemas" component={Cinemas} />
                        {/* 模糊匹配  精确匹配 exact */}
                        <Redirect from='/' to='/films' exact/>
                        <Route component={NotFound}/>
                    </Switch>
                </HashRouter>
            </div>
        )
    }
}
